export function transTreeData(source) {
  const targetList = []
  const map = {}
  source.forEach(item => {
    map[item.id] = item
    item.children = []
  })
  source.forEach(item => {
    if (map[item.pid]) {
      map[item.pid].children.push(item)
    } else {
      targetList.push(item)
    }
  })
  return targetList
}
